package lang.String;

import java.net.URI;
import java.net.URISyntaxException;

/**
 * @author xiaoming
 * @version 1.0
 * @date 2018-11-13 19:34
 **/
public class SubString {
    public static void main(String[] args) {
        String s = "http://cloud.52liming.com:80/a/b";
        String ss = s.substring(s.indexOf("://")+3 , s.lastIndexOf(":"));
        System.out.println(ss);

        try {
            URI uri = new URI("http://cloud.52liming.com:80/a/b");
            System.out.println(uri.getHost());
        } catch (URISyntaxException e) {
            e.printStackTrace();
        }
    }
}
